<?php

require __DIR__ . "/../vendor/autoload.php";

use Queue\Interfaces\TaskInterface;

if (count($argv) < 2) {
    throw new InvalidArgumentException("Invalid call");
}

$script = array_shift($argv);

$task = array_shift($argv);

$task = @unserialize(base64_decode($task));

if ($task instanceof TaskInterface) {
    $task->execute();
}
